<HTML>
 
<!-- Mirrored from www.javapractices.com/apps/movies/javadoc/src-html/hirondelle/movies/util/ui/OnClose.html by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 12 Jun 2011 17:30:21 GMT -->
<HEAD>
  <TITLE>
OnClose.java
  </TITLE>
  <LINK REL ='stylesheet' TYPE='text/css' HREF='../../../../../highlight.css' TITLE='Style'>
 </HEAD>
 <BODY>
<PRE>
<span class='keyword'>package</span> hirondelle.movies.util.ui;<a name=line.1></a>
<a name=line.2></a>
<span class='keyword'>import</span> <span class='keyword'>static</span> javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE;<a name=line.3></a>
<span class='keyword'>import</span> <span class='keyword'>static</span> javax.swing.WindowConstants.HIDE_ON_CLOSE;<a name=line.4></a>
<span class='keyword'>import</span> <span class='keyword'>static</span> javax.swing.WindowConstants.DISPOSE_ON_CLOSE;<a name=line.5></a>
<span class='keyword'>import</span> <span class='keyword'>static</span> javax.swing.WindowConstants.EXIT_ON_CLOSE;<a name=line.6></a>
<a name=line.7></a>
<span class='comment'>/**<a name=line.8></a>
 Enumeration of various close operations.<a name=line.9></a>
 <a name=line.10></a>
 &lt;P&gt;Use of such an enumeration provides a clearer and safer alternative to using <a name=line.11></a>
 the members of {@link javax.swing.WindowConstants}.<a name=line.12></a>
 <a name=line.13></a>
  &lt;P&gt;It is important to note that <a name=line.14></a>
  {@link javax.swing.JDialog#setDefaultCloseOperation(int)} allows for <a name=line.15></a>
  only 3 of these operations. It does not allow for {@link #EXIT}. <a name=line.16></a>
*/</span><a name=line.17></a>
<span class='keyword'>public</span> <span class='keyword'>enum</span> OnClose {<a name=line.18></a>
  DISPOSE(DISPOSE_ON_CLOSE), <a name=line.19></a>
  DO_NOTHING(DO_NOTHING_ON_CLOSE), <a name=line.20></a>
  HIDE(HIDE_ON_CLOSE),<a name=line.21></a>
  EXIT(EXIT_ON_CLOSE);<a name=line.22></a>
  <a name=line.23></a>
  <span class='comment'>/**<a name=line.24></a>
   Return the integer value of the corresponding constant in {@link javax.swing.WindowConstants}.<a name=line.25></a>
  */</span><a name=line.26></a>
  <span class='keyword'>public</span> <span class='keyword'>int</span> getIntValue(){ <span class='keyword'>return</span> fOption; }<a name=line.27></a>
  <a name=line.28></a>
  <span class='comment'>/** Only private constructors should be used with enumerations. */</span> <a name=line.29></a>
  <span class='keyword'>private</span> OnClose(<span class='keyword'>int</span> aUnderlyingOption){<a name=line.30></a>
    fOption = aUnderlyingOption;<a name=line.31></a>
  }<a name=line.32></a>
  <span class='keyword'>private</span> <span class='keyword'>int</span> fOption;<a name=line.33></a>
}<a name=line.34></a>
 <a name=line.35></a>
</PRE><a name=line.36></a>
 </BODY><a name=line.37></a>
<HTML><a name=line.38></a>
